package com.fighYo.trace.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fighYo.trace.entity.Secret;
import com.fighYo.trace.entity.User;
import com.fighYo.trace.mapper.SecretMapper;
import com.fighYo.trace.service.SecretService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.management.Query;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author fighYo
 * @since 2022-04-11
 */
@Service
public class SecretServiceImpl extends ServiceImpl<SecretMapper, Secret> implements SecretService {

    @Override
    public Secret getSecret(User user) {
        String userName = user.getUserName();
//        String userType = user.getUserType();

        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("user_name", userName);
//        wrapper.eq("user_type", userType);

        return baseMapper.selectOne(wrapper);
    }
}
